<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pybindgen.typehandlers.base.TypeTransformation</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pybindgen-module.html">Package&nbsp;pybindgen</a> ::
        <a href="pybindgen.typehandlers-module.html">Package&nbsp;typehandlers</a> ::
        <a href="pybindgen.typehandlers.base-module.html">Module&nbsp;base</a> ::
        Class&nbsp;TypeTransformation
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pybindgen.typehandlers.base.TypeTransformation-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class TypeTransformation</h1><p class="nomargin-top"><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_pybindge_91" name="uml_class_diagram_for_pybindge_91">
<area shape="rect" href="pybindgen.typehandlers.base.TypeTransformation-class.html#get_untransformed_name" title="Given a transformed named, get the original C type name." alt="" coords="17,36,391,55"/>
<area shape="rect" href="pybindgen.typehandlers.base.TypeTransformation-class.html#create_type_handler" title="Given a type_handler class, create an instance with proper customization." alt="" coords="17,55,391,73"/>
<area shape="rect" href="pybindgen.typehandlers.base.TypeTransformation-class.html#transform" title="Transforms a value expression of the original type to an equivalent value &#160;expression in the transformed type." alt="" coords="17,73,391,92"/>
<area shape="rect" href="pybindgen.typehandlers.base.TypeTransformation-class.html#untransform" title="Transforms a value expression of the transformed type to an equivalent &#160;value expression in the original type." alt="" coords="17,92,391,111"/>
<area shape="rect" href="pybindgen.typehandlers.base.TypeTransformation-class.html" title="Type transformations are used to register handling of special types that are simple transformation over another type that is already registered." alt="" coords="16,11,392,112"/>
</map>
  <img src="uml_class_diagram_for_pybindge_91.gif" alt='' usemap="#uml_class_diagram_for_pybindge_91" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Type transformations are used to register handling of special types 
  that are simple transformation over another type that is already 
  registered.  This way, only the original type is registered, and the type
  transformation only does the necessary adjustments over the original type
  handler to make it handle the transformed type as well.</p>
  <p>This is typically used to get smart pointer templated types 
  working.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.TypeTransformation-class.html#get_untransformed_name" class="summary-sig-name">get_untransformed_name</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Given a transformed named, get the original C type name.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.get_untransformed_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.TypeTransformation-class.html#create_type_handler" class="summary-sig-name">create_type_handler</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">type_handler_class</span>,
        <span class="summary-sig-arg">*args</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span><br />
      Given a type_handler class, create an instance with proper 
      customization.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.create_type_handler">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.TypeTransformation-class.html#transform" class="summary-sig-name">transform</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">type_handler</span>,
        <span class="summary-sig-arg">declarations</span>,
        <span class="summary-sig-arg">code_block</span>,
        <span class="summary-sig-arg">value</span>)</span><br />
      Transforms a value expression of the original type to an equivalent 
      value expression in the transformed type.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.transform">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.base.TypeTransformation-class.html#untransform" class="summary-sig-name">untransform</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">type_handler</span>,
        <span class="summary-sig-arg">declarations</span>,
        <span class="summary-sig-arg">code_block</span>,
        <span class="summary-sig-arg">value</span>)</span><br />
      Transforms a value expression of the transformed type to an 
      equivalent value expression in the original type.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.untransform">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__init__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="get_untransformed_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_untransformed_name</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.get_untransformed_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Given a transformed named, get the original C type name. E.g., given a
  smart pointer transformation, MySmartPointer:</p>
<pre class="literalblock">
 get_untransformed_name('MySmartPointer&lt;Foo&gt;') -&gt; 'Foo*'
</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="create_type_handler"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">create_type_handler</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">type_handler_class</span>,
        <span class="sig-arg">*args</span>,
        <span class="sig-arg">**kwargs</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.create_type_handler">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Given a type_handler class, create an instance with proper 
  customization.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>type_handler_class</code></strong> - type handler class</li>
        <li><strong class="pname"><code>args</code></strong> - arguments</li>
        <li><strong class="pname"><code>kwargs</code></strong> - keywords arguments</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="transform"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">transform</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">type_handler</span>,
        <span class="sig-arg">declarations</span>,
        <span class="sig-arg">code_block</span>,
        <span class="sig-arg">value</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.transform">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Transforms a value expression of the original type to an equivalent 
  value expression in the transformed type.</p>
  <p>Example, with the transformation:</p>
<pre class="literalblock">
  'T*' -&gt; 'boost::shared_ptr&lt;T&gt;'
</pre>
  <p>Then:</p>
<pre class="literalblock">
  transform(wrapper, 'foo') -&gt; 'boost::shared_ptr&lt;%s&gt;(foo)' % type_handler.untransformed_ctype
</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="untransform"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">untransform</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">type_handler</span>,
        <span class="sig-arg">declarations</span>,
        <span class="sig-arg">code_block</span>,
        <span class="sig-arg">value</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.base-pysrc.html#TypeTransformation.untransform">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Transforms a value expression of the transformed type to an equivalent
  value expression in the original type.</p>
  <p>Example, with the transformation:</p>
<pre class="literalblock">
 'T*' -&gt; 'boost::shared_ptr&lt;T&gt;'
</pre>
  <p>Then:</p>
<pre class="literalblock">
  untransform(wrapper, 'foo') -&gt; 'foo-&gt;get_pointer()'
</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Jul 12 17:23:32 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
